<!DOCTYPE html>
<html lang="en">
<head>
    <meta name="layout" content="bocMain"/>
    <title>进件作业系统</title>
</head>

<body>
<header class="header-title">面谈表</header>
<g:render template="/layouts/bocAppTemplate/contactInfoTemplate"/>
<div class="">
    <div class="weui-cells__title">请填写以下内容</div>
    <g:form action="createInterviewFormSave" method="post" class="myForm">
        <input type="hidden" name="id" id="id" value="${this?.opportunity?.id}">

        <div class="tab-info">
            <div class="title active">信用卡产品信息<i class="arrow"></i></div>

            <div class="hide weui-cells weui-cells_form weui-label-10">
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">信用卡卡号</label></div>

                    <div class="weui-cell__bd">
                        <input class="weui-input hide" name="bankAccount.type" value="${com.next.BankAccountType.findByName('信用卡')?.id}" />
                        <input class="weui-input" type="number" name="bankAccount.numberOfAccount" id="numberOfAccount" placeholder="请输入"/>
                    </div>
                </div>

                <div class="hide" id="bankAccountInfo">
                    <div class="weui-cell weui-cell_select weui-cell_select-after">
                        <div class="weui-cell__hd"><label class="weui-label">是否实时发卡</label></div>

                        <div class="weui-cell__bd">
                            <g:select class="weui-select" name="bankAccount.isIssuingCardImmediately" id="isIssuingCardImmediately" from="${[[name: '是', value: true], [name: '否', value: false]]}" optionKey="value" optionValue="name" noSelection="${['': '请选择']}"/>
                        </div>
                    </div>

                    <div class="hide" id="bankAccountInfo1">
                        <div class="weui-cell weui-cell_select weui-cell_select-after">
                            <div class="weui-cell__hd"><label class="weui-label">账单卡片寄送地址类型</label></div>

                            <div class="weui-cell__bd">
                                <g:select class="weui-select" name="bankAccount.postAddressType" id="postAddressType"
                                          from="${com.next.BankAccount.constrainedProperties.postAddressType.inList}"
                                          noSelection="${['': '请选择']}"></g:select>
                            </div>
                        </div>

                        <div class="weui-cell">
                             <div class="weui-cell__hd"><label class="weui-label">账单卡片寄送地址</label></div>

                             <div class="weui-cell__bd">
                                 <g:textField class="weui-input" name="bankAccount.postAddress" id="postAddress" placeholder="请输入" readonly="true"/>
                             </div>
                         </div>

                        <div class="weui-cell weui-cell_select weui-cell_select-after">
                            <div class="weui-cell__hd"><label class="weui-label">对账单发送方式</label></div>

                            <div class="weui-cell__bd">
                                <g:select class="weui-select" id="billSentMethod" name="bankAccount.billSentMethod" from="${com.next.BankAccount.constrainedProperties.billSentMethod.inList}" noSelection="${['': '请选择']}"></g:select>
                            </div>
                        </div>

                        <div class="weui-cell hide" id="emailDiv">
                             <div class="weui-cell__hd"><label class="weui-label">E-mail</label></div>

                             <div class="weui-cell__bd">
                                 <g:textField class="weui-input" name="bankAccount.billSentEmail" id="billSentEmail" placeholder="请输入"/>
                             </div>
                         </div>

                        <div class="weui-cell weui-cell_select weui-cell_select-after">
                            <div class="weui-cell__hd"><label class="weui-label">住宅性质</label></div>

                            <div class="weui-cell__bd">
                                <g:select class="weui-select" id="houseProperty" name="bankAccount.houseProperty" from="${['亲属产权', '单位宿舍', '无按揭自置', '按揭自置', '租用']}" value="" noSelection="${['': '请选择']}"/>
                            </div>
                        </div>

                        <div class="weui-cell weui-cell_select weui-cell_select-after">
                            <div class="weui-cell__hd"><label class="weui-label">还款方式</label></div>

                            <div class="weui-cell__bd">
                                <g:select class="weui-select" id="creditCardPaymentMethod" name="bankAccount.creditCardPaymentMethod" from="${com.next.BankAccount.constrainedProperties.creditCardPaymentMethod.inList}" noSelection="${['': '请选择']}"></g:select>
                            </div>
                        </div>

                        <div class="hide" id="provinceDiv">
                            <div class="weui-cell weui-cell_select weui-cell_select-after">
                                <div class="weui-cell__hd"><label class="weui-label">开户行所在省市</label></div>

                                <div class="weui-cell__bd">
                                    <g:select class="weui-select" name="bankAccount.province" id="province" optionKey="id" optionValue="name" from="${com.next.Province.list()}" noSelection="${['': '请选择']}"/>
                                </div>
                            </div>

                            <div class="weui-cell">
                                <div class="weui-cell__hd"><label class="weui-label">人民币账号</label></div>

                                <div class="weui-cell__bd">
                                    <input class="weui-input hide" name="bankAccount1.type" value="${com.next.BankAccountType.findByName('借记卡')?.id}" />
                                    <g:textField class="weui-input" name="bankAccount1.numberOfAccount" placeholder="请输入"/>
                                </div>
                            </div>
                        </div>

                        <div class="weui-cell weui-cell_select weui-cell_select-after">
                            <div class="weui-cell__hd"><label class="weui-label">还款账户选择</label></div>

                            <div class="weui-cell__bd">
                                <g:select class="weui-select" id="creditCardPaymentAccount" name="bankAccount.creditCardPaymentAccount" from="${com.next.BankAccount.constrainedProperties.creditCardPaymentAccount.inList}" noSelection="${['': '请选择']}"></g:select>
                            </div>
                        </div>

                        <div class="weui-cell">
                            <div class="weui-cell__hd"><label class="weui-label">优先级</label></div>

                            <div class="weui-cell__bd">
                                <g:textField class="weui-input" id="priority" name="bankAccount.priority" placeholder="请输入"/>
                            </div>
                        </div>


                        <div class="weui-cell weui-cell_select weui-cell_select-after">
                            <div class="weui-cell__hd"><label class="weui-label">卡面名称</label></div>

                            <div class="weui-cell__bd">
                                <g:select class="weui-select" name="bankAccount.name" id="name"
                                          from="${['长城环球通爱驾汽车信用卡', '长城环球通爱家信用卡', '易分享自动分期白金信用卡']}"
                                          noSelection="${['': '请选择']}"/>
                            </div>
                        </div>

                        <div class="weui-cell">
                            <div class="weui-cell__hd"><label class="weui-label">卡面代码</label></div>

                            <div class="weui-cell__bd">
                                <g:textField class="weui-input" name="bankAccount.code" id="code" placeholder="请输入" readonly="true"/>
                            </div>
                        </div>

                        <div class="weui-cell">
                            <div class="weui-cell__hd"><label class="weui-label">是否申请循环额度</label></div>

                            <div class="weui-cell__bd">
                                <g:select class="weui-select" name="bankAccount.circulationQuota" id="circulationQuota"
                                          from="${[[name: '申请循环额度', value: true], [name: '申请零额度', value: false]]}" optionKey="value"
                                          optionValue="name" noSelection="${['': '请选择']}"/>
                            </div>
                        </div>

                        <div class="weui-cell">
                            <div class="weui-cell__hd"><label class="weui-label">BH（分行网点号）</label></div>

                            <div class="weui-cell__bd">
                                <g:textField class="weui-input" id="branchCode" name="bankAccount.branchCode" placeholder="请输入"/>
                            </div>
                        </div>

                        <div class="weui-cell">
                            <div class="weui-cell__hd"><label class="weui-label">IN（营销人员代码）</label></div>

                            <div class="weui-cell__bd">
                                <g:textField class="weui-input" id="marketerCode" name="bankAccount.marketerCode" placeholder="请输入"/>
                            </div>
                        </div>
                        <div class="weui-cell">
                            <div class="weui-cell__hd"><label class="weui-label">CC（营销活动代号）</label></div>

                            <div class="weui-cell__bd">
                                <g:textField class="weui-input" id="marketingCampaignCode" name="bankAccount.marketingCampaignCode" placeholder="请输入"/>
                            </div>
                        </div>

                        <div class="weui-cell weui-cell_select weui-cell_select-after">
                            <div class="weui-cell__hd"><label class="weui-label">免年费类型类别</label></div>

                            <div class="weui-cell__bd">
                                <g:select class="weui-select" id="noAnnualFeeType" name="bankAccount.noAnnualFeeType" from="${com.next.BankAccount.constrainedProperties.noAnnualFeeType.inList}" noSelection="${['': '请选择']}"></g:select>
                            </div>
                        </div>

                        <div class="weui-cell weui-cell_select weui-cell_select-after">
                            <div class="weui-cell__hd"><label class="weui-label">申请信用卡类别</label></div>

                            <div class="weui-cell__bd">
                                <g:select class="weui-select" name="bankAccount.subType" id="subType" optionKey="id" optionValue="name" from="${com.next.BankAccountSubType.list()}" noSelection="${['': '请选择']}"/>
                            </div>
                        </div>

                        <div class="weui-cell weui-cell_select weui-cell_select-after">
                            <div class="weui-cell__hd"><label class="weui-label">是否有增额意愿</label></div>

                            <div class="weui-cell__bd">
                                <g:select class="weui-select" name="bankAccount.wannaToIncreaseQuota" id="wannaToIncreaseQuota"
                                          from="${[[name: '有', value: true], [name: '没有', value: false]]}" optionKey="value"
                                          optionValue="name" noSelection="${['': '请选择']}"/>

                            </div>
                        </div>

                        <div class="weui-cell weui-cell_select weui-cell_select-after">
                            <div class="weui-cell__hd"><label class="weui-label">联系人是否是客户经理</label></div>

                            <div class="weui-cell__bd">
                                <g:select class="weui-select" name="bankAccount.connectmanIsClientManager" id="connectmanIsClientManager"
                                          from="${[[name: '是', value: true], [name: '否', value: false]]}" optionKey="value"
                                          optionValue="name" noSelection="${['': '请选择']}"/>
                            </div>
                        </div>

                        <div class="weui-cell weui-cell_select weui-cell_select-after">
                            <div class="weui-cell__hd"><label class="weui-label">还款金额选择</label></div>

                            <div class="weui-cell__bd">
                                <g:select class="weui-select" id="creditCardPaymentType" name="bankAccount.creditCardPaymentType" from="${com.next.BankAccount.constrainedProperties.creditCardPaymentType.inList}" noSelection="${['': '请选择']}"></g:select>
                            </div>
                        </div>

                        <div class="weui-cell weui-cell_select weui-cell_select-after">
                            <div class="weui-cell__hd"><label class="weui-label">刷卡消费方式选择</label></div>

                            <div class="weui-cell__bd">
                                <g:select class="weui-select" id="creditCardPayMethod" name="bankAccount.creditCardPayMethod" from="${com.next.BankAccount.constrainedProperties.creditCardPayMethod.inList}" noSelection="${['': '请选择']}"></g:select>
                            </div>
                        </div>

                        <div class="weui-cell">
                            <div class="weui-cell__hd"><label class="weui-label">母亲姓氏</label></div>

                            <div class="weui-cell__bd">
                                <g:textField class="weui-input" id="surnameOfMother" name="bankAccount.surnameOfMother" placeholder="请输入"/>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="tab-info">
            <div class="title active">申请分期类型<i class="arrow"></i></div>

            <div class="hide weui-cells weui-cells_form weui-label-10">

                <div class="weui-cell weui-cell_select weui-cell_select-after">
                    <div class="weui-cell__hd"><label class="weui-label">分期类型</label></div>

                    <div class="weui-cell__bd">
                        <g:select class="weui-select" name="subtype" id="subtype" value="${this.opportunity?.subtype?.id}" optionKey="id"
                          optionValue="name" from="${com.next.OpportunitySubtype.list()}" noSelection="${['': '请选择']}"/>
                    </div>
                </div>

                <div class="weui-cell weui-cell_select weui-cell_select-after">
                    <div class="weui-cell__hd"><label class="weui-label">本金还款方式</label></div>

                    <div class="weui-cell__bd">
                        <g:select class="weui-select" name="principalPaymentMethod" id="principalPaymentMethod"
                                  value="${this.opportunity?.principalPaymentMethod?.id}" optionKey="id"
                                  optionValue="name" from="${com.next.PrincipalPaymentMethod.list()}"
                                  noSelection="${['': '请选择']}"/>
                    </div>
                </div>

                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">分期额度</label></div>

                    <div class="weui-cell__bd">
                        <input class="weui-input" type="number" name="maximumAmountOfCredit" id="maximumAmountOfCredit"
                               value="${this?.opportunity?.maximumAmountOfCredit ?: ''}" placeholder="请输入" />
                    </div>
                </div>

                <div class="weui-cell weui-cell_select weui-cell_select-after">
                    <div class="weui-cell__hd"><label class="weui-label">手续费分期</label></div>

                    <div class="weui-cell__bd">
                        <g:select class="weui-select" name="commissionPaymentMethod" id="commissionPaymentMethod"
                                  value="${this.opportunity?.commissionPaymentMethod?.id}" optionKey="id"
                                  optionValue="name" from="${com.next.CommissionPaymentMethod.list()}"
                                  noSelection="${['': '请选择']}"/>
                    </div>
                </div>

                <div class="weui-cell weui-cell_select weui-cell_select-after">
                    <div class="weui-cell__hd"><label class="weui-label">还款周期</label></div>

                    <div class="weui-cell__bd">
                        <g:select class="weui-select" id="repaymentPeriod" name="repaymentPeriod" from="${com.next.Opportunity.constrainedProperties.repaymentPeriod.inList}" value="${this?.opportunity?.repaymentPeriod}" noSelection="${['': '请选择']}"></g:select>
                    </div>
                </div>

                <div class="weui-cell weui-cell_select weui-cell_select-after">
                    <div class="weui-cell__hd"><label class="weui-label">分期期数</label></div>

                    <div class="weui-cell__bd">
                        <g:select class="weui-select" id="loanDuration" name="loanDuration"
                                  from="[6, 12, 24, 36, 48, 60, 96]" value="${this?.opportunity?.loanDuration}"
                                  noSelection="${['': '请选择']}"/>
                    </div>
                </div>

                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">客户费率</label></div>

                    <div class="weui-cell__bd">
                       <input class="weui-input" type="number" name="monthlyInterestTemp" id="monthlyInterestTemp" value="${this?.opportunity?.ompositeMonthlyInterest?this?.opportunity?.ompositeMonthlyInterest * 100 : ''}" placeholder="请输入"/>
                    </div>

                    <div class="weui-cell__hd"><label class="weui-label rightUnit">%</label></div>
                </div>

                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">手续费</label></div>

                    <div class="weui-cell__bd">
                        <input class="weui-input" type="number" name="commission" id="commission"
                               value="${this?.opportunity?.commission ?: ''}" placeholder="请输入" readonly="true"/>
                    </div>

                    <div class="weui-cell__hd"><label class="weui-label rightUnit">元</label></div>
                </div>

                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">厂商贴息费率</label></div>

                    <div class="weui-cell__bd">
                       <input class="weui-input" type="number" name="commissionRateTemp" id="commissionRateTemp" value="${this?.opportunity?.commissionRate * 100 ?: ''}" placeholder="请输入"/>
                    </div>

                    <div class="weui-cell__hd"><label class="weui-label rightUnit">%</label></div>
                </div>

                <div class="weui-cell weui-cell_select weui-cell_select-after">
                    <div class="weui-cell__hd"><label class="weui-label">支付方式</label></div>

                    <div class="weui-cell__bd">
                        <g:select class="weui-select" name="paymentMode" id="paymentMode" from="['受托支付','自主支付']" value="${this?.opportunity?.paymentMode}" noSelection="${['': '请选择']}"/>
                    </div>
                </div>

                <div class="weui-cell weui-cell_select weui-cell_select-after">
                    <div class="weui-cell__hd"><label class="weui-label">担保类型</label></div>

                    <div class="weui-cell__bd">
                        <g:select class="weui-select" name="guaranteeType" id="guaranteeType"
                                  value="${this.opportunity?.guaranteeType?.id}" optionKey="id"
                                  optionValue="name" from="${com.next.GuaranteeType.list()}"
                                  noSelection="${['': '请选择']}"/>
                    </div>
                </div>

                <div class="weui-cell weui-cell_select weui-cell_select-after">
                    <div class="weui-cell__hd"><label class="weui-label">担保品修改标识</label></div>
                    <div class="weui-cell__bd">
                        <g:select class="weui-select" id="collateralIsModified" name="collateralIsModified" from="['是', '否', '无']" value="${this?.opportunity?.collateralIsModified}" noSelection="${['': '请选择']}"/>
                    </div>
                </div>
            </div>
        </div>

        <div class="tab-info">
            <div class="title active">交易信息<i class="arrow"></i></div>

            <div class="hide weui-cells weui-cells_form weui-label-10">
                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">省份</label></div>

                    <div class="weui-cell__bd">
                        <g:textField class="weui-input" name="provinceName" id="provinceName" placeholder="请输入" value="${this?.opportunity?.user?.account?.province?.name}" readonly="true"/>
                    </div>
                </div>

                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">城市</label></div>

                    <div class="weui-cell__bd">
                        <g:textField class="weui-input" name="cityName" id="cityName" placeholder="请输入" value="${this?.opportunity?.user?.account?.city?.name}" readonly="true"/>
                    </div>
                </div>

                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">经销商</label></div>

                    <div class="weui-cell__bd">
                        <g:textField class="weui-input" name="accountName" id="accountName" placeholder="请输入" value="${this?.opportunity?.account?.name}" readonly="true"/>
                    </div>
                </div>

                <div class="weui-cell weui-cell_select weui-cell_select-after">
                    <div class="weui-cell__hd"><label class="weui-label">汽车品牌</label></div>

                    <div class="weui-cell__bd">
                        <g:select class="weui-select" name="vehicle.brand" id="brand" optionKey="id" optionValue="name" from="${com.next.VehicleBrand.list()}" noSelection="${['': '请选择']}"/>
                    </div>
                </div>

                <div class="weui-cell weui-cell_select weui-cell_select-after">
                    <div class="weui-cell__hd"><label class="weui-label">汽车系列</label></div>

                    <div class="weui-cell__bd">
                        <g:select class="weui-select" name="vehicle.series" id="series" optionKey="id" optionValue="name" from="${com.next.VehicleSeries.list()}" noSelection="${['': '请选择']}"/>
                    </div>
                </div>

                <div class="weui-cell weui-cell_select weui-cell_select-after">
                    <div class="weui-cell__hd"><label class="weui-label">汽车车型</label></div>

                    <div class="weui-cell__bd">
                        <g:select class="weui-select" name="vehicle.marque" id="marque" optionKey="id" optionValue="name" from="${com.next.VehicleMarque.list()}" noSelection="${['': '请选择']}"/>
                    </div>
                </div>

                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">汽车厂商</label></div>

                    <div class="weui-cell__bd">
                        <g:textField class="weui-input" name="vehicle.manufacturer" id="manufacturer" placeholder="请输入"/>
                    </div>
                </div>

                <g:textField class="weui-input hide" name="requestedAmount" id="requestedAmount" value="${this?.opportunity?.requestedAmount}"/>

                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">车架号码</label></div>

                    <div class="weui-cell__bd">
                        <g:textField class="weui-input" name="vehicle.carframeCode" id="carframeCode" placeholder="请输入"/>
                    </div>
                </div>

                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">厂牌车型</label></div>

                    <div class="weui-cell__bd">
                        <g:textField class="weui-input" name="vehicle.manufacturerVehicleMarque"
                                     id="manufacturerVehicleMarque" placeholder="请输入"/>
                    </div>
                </div>

                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">净车价</label></div>

                    <div class="weui-cell__bd">
                        <input class="weui-input" type="number" name="vehicle.vehicleAmount" id="vehicleAmount" placeholder="请输入" value="${this?.opportunity?.loanAmount}" />
                    </div>

                    <div class="weui-cell__hd"><label class="weui-label rightUnit">元</label></div>
                </div>

                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">经销商客户号</label></div>

                    <div class="weui-cell__bd">
                        <g:textField class="weui-input" name="vehicle.distributorCustomerCode"
                                     id="distributorCustomerCode" placeholder="请输入"/>
                    </div>
                </div>

                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">经销商名称</label></div>

                    <div class="weui-cell__bd">
                        <g:textField class="weui-input" name="vehicle.vehicleProvider" id="vehicleProvider"
                                     placeholder="请输入"/>
                    </div>
                </div>

                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">零贷项目号</label></div>

                    <div class="weui-cell__bd">
                        <g:textField class="weui-input" name="vehicle.projectCode" id="projectCode" placeholder="请输入"/>
                    </div>
                </div>

                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">零贷项目号名称</label></div>

                    <div class="weui-cell__bd">
                        <g:textField class="weui-input" name="vehicle.projectName" id="projectName" placeholder="请输入"/>
                    </div>
                </div>

                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">购车合同号</label></div>

                    <div class="weui-cell__bd">
                        <g:textField class="weui-input" name="vehicle.propertySerialNumber" id="propertySerialNumber"
                                     placeholder="请输入"/>
                    </div>
                </div>

                <div class="weui-cell weui-cell_select weui-cell_select-after">
                    <div class="weui-cell__hd"><label class="weui-label">购车用途</label></div>

                    <div class="weui-cell__bd">
                        <g:select class="weui-select" id="purpose" name="vehicle.purpose" from="${com.next.Vehicle.constrainedProperties.purpose.inList}" noSelection="${['': '请选择']}"></g:select>
                    </div>
                </div>

                <div class="weui-cell weui-cell_select weui-cell_select-after">
                    <div class="weui-cell__hd"><label class="weui-label">购车产地</label></div>

                    <div class="weui-cell__bd">
                        <g:select class="weui-select" id="purchaseSite" name="vehicle.purchaseSite" from="${com.next.Vehicle.constrainedProperties.purchaseSite.inList}" noSelection="${['': '请选择']}"></g:select>
                    </div>
                </div>

                <div class="weui-cell hide" id="importOddNumberDiv">
                    <div class="weui-cell__hd"><label class="weui-label">进口单号</label></div>

                    <div class="weui-cell__bd">
                        <g:textField class="weui-input" name="vehicle.importOddNumber" id="importOddNumber" placeholder="请输入"/>
                    </div>
                </div>

                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">自有资金</label></div>

                    <div class="weui-cell__bd">
                        <input class="weui-input" type="number" name="ownFunds" id="ownFunds" value="${this?.opportunity?.ownFunds}" placeholder="请输入"/>
                    </div>
                </div>

                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">账户名称</label></div>

                    <div class="weui-cell__bd">
                        <g:textField class="weui-input" name="bankAccount3.name" placeholder="请输入"/>
                    </div>
                </div>

                <div class="weui-cell">
                    <div class="weui-cell__hd"><label class="weui-label">账号</label></div>

                    <div class="weui-cell__bd">
                        <input class="weui-input hide" name="bankAccount3.type" value="${com.next.BankAccountType.findByName('借记卡')?.id}" />
                        <g:textField class="weui-input" name="bankAccount3.numberOfAccount" placeholder="请输入"/>
                    </div>
                </div>

                <div class="weui-cell weui-cell_select weui-cell_select-after">
                    <div class="weui-cell__hd"><label class="weui-label">开户行</label></div>

                    <div class="weui-cell__bd">
                        <g:select class="weui-select" name="bankAccount3.bank" optionKey="id" optionValue="name" from="${com.next.Bank.list()}" noSelection="${['': '请选择']}"/>
                    </div>
                </div>

                <div class="weui-cell weui-cell_select weui-cell_select-after">
                    <div class="weui-cell__hd"><label class="weui-label">账户类别</label></div>

                    <div class="weui-cell__bd">
                        <g:select class="weui-select" name="bankAccount3.accountType" from="${com.next.BankAccount.constrainedProperties.accountType.inList}" noSelection="${['': '请选择']}"></g:select>
                    </div>
                </div>

            </div>
        </div>
    </g:form>

    <div class="bigBtn">
        <button type="button" class="weui-btn weui-btn_primary" id="submit">下一步</button>
    </div>
</div>

<script>
    $(function ()
    {
        setOwnFundsValue();

        $("#vehicleAmount").blur(function () {
            setOwnFundsValue();
        });

        function setOwnFundsValue()
        {
            var vehicleAmount = $("#vehicleAmount").val();
            var requestedAmount = $("#requestedAmount").val();
            if (vehicleAmount && requestedAmount) {
                $("#ownFunds").val(vehicleAmount - requestedAmount);
            }
        }

        $("#billSentMethod").change(function () {
            var billSentMethod = $(this).val().trim();
            if (billSentMethod == "E-mail")
            {
                $('#emailDiv').removeClass("hide");
            }
            else
            {
                $('#emailDiv').addClass("hide");
            }
        });

        $("#numberOfAccount").blur(function()
        {
            var numberOfAccount = $("#numberOfAccount").val();
            if (numberOfAccount && numberOfAccount == 0)
            {
                $('#bankAccountInfo').removeClass("hide");
            }
            else
            {
                $('#bankAccountInfo').addClass("hide");
            }
        })

        $("#isIssuingCardImmediately").change(function () {
            var isIssuingCardImmediately = $(this).val().trim();
            if (isIssuingCardImmediately == "true")
            {
                $('#bankAccountInfo1').removeClass("hide");
            }
            else
            {
                $('#bankAccountInfo1').addClass("hide");
            }
        });

        $("#creditCardPaymentMethod").change(function () {
            var modeRepayment = $(this).val().trim();
            if (modeRepayment == "自动还款") {
                $('#provinceDiv').removeClass("hide");
            } else {
                $('#provinceDiv').addClass("hide");
            }
        });

        $("#purchaseSite").change(function () {
            var purchaseSite = $(this).val().trim();
            if (purchaseSite == "进口") {
                $('#importOddNumberDiv').removeClass("hide");
            } else {
                $('#importOddNumberDiv').addClass("hide");
            }
        });

        $("#postAddressType").change(function () {
            var postAddress
            var postAddressType = $("#postAddressType").val();
            if (postAddressType == '住宅地址') {
                postAddress = '${this?.opportunity?.contact?.city?.name}' + '${this?.opportunity?.contact?.district?.name}' + '${this?.opportunity?.contact?.address}'
            }
            if (postAddressType == '单位地址') {
                postAddress = '${this?.opportunity?.contact?.companyAddress}'
            }
            $("#postAddress").val(postAddress);
        });

        $("#maximumAmountOfCredit").blur(function () {
            var monthlyInterestTemp = $("#monthlyInterestTemp").val();
            var maximumAmountOfCredit = $("#maximumAmountOfCredit").val();
            if (maximumAmountOfCredit && monthlyInterestTemp) {
                $("#commission").val(maximumAmountOfCredit * monthlyInterestTemp / 100);
            }
        });
        $("#monthlyInterestTemp").blur(function () {
            var monthlyInterestTemp = $("#monthlyInterestTemp").val();
            var maximumAmountOfCredit = $("#maximumAmountOfCredit").val();
            if (maximumAmountOfCredit && monthlyInterestTemp) {
                $("#commission").val(maximumAmountOfCredit * monthlyInterestTemp / 100);
            }
        });

        $("#name").change(function () {
            var name = $("#name").val();
            if (name == '长城环球通爱驾汽车信用卡') {
                $('#code').val('6193');
            }
            if (name == '长城环球通爱家信用卡') {
                $('#code').val('6231');
            }
            if (name == '易分享自动分期白金信用卡') {
                $('#code').val('0113');
            }
        });

        $(".tab-info .title").click(function () {
            $(this).toggleClass('active').next(".weui-cells").fadeToggle(300);
        });

        $("#submit").click(function () {

            var numberOfAccount = $("#numberOfAccount").val();
            if (!numberOfAccount) {
                helpMessage("请输入信用卡卡号");
                return;
            }

            // var postAddress = $("#postAddress").val();
            // if (!postAddress) {
            //     helpMessage("账单卡片寄送地址");
            //     return;
            // }

            // var code = $("#code").val();
            // if (!code) {
            //     helpMessage("请输入卡面代码");
            //     return;
            // }

            // var name = $("#name").val();
            // if (!name) {
            //     helpMessage("请输入卡面简称");
            //     return;
            // }

            var billSentEmail = $("#billSentEmail").val().trim();
            if (billSentEmail && !(/^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/.test(billSentEmail))) {
                helpMessage("请输入正确E-mail");
                return;
            }
            
            var maximumAmountOfCredit = $("#maximumAmountOfCredit").val().trim();
            if (!maximumAmountOfCredit) {
                helpMessage("请输入分期额度");
                return;
            }

            var loanDuration = $("#loanDuration").val();
            if (!loanDuration) {
                helpMessage("请输入分期期数");
                return;
            }
            var monthlyInterestTemp = $("#monthlyInterestTemp").val();
            if (!monthlyInterestTemp) {
                helpMessage("请输入客户费率");
                return;
            }

            var vehicleBrand = $("#vehicleBrand").val()
            if (!vehicleBrand) {
                helpMessage("请输入汽车品牌");
                return;
            }

            $(".myForm").submit();
        })

        function helpMessage(message) {
            $(".helpMsg").text(message).fadeIn(200);
            setTimeout(function () {
                $(".helpMsg").fadeOut(200);
            }, 2000);
        }

        $("#brand").bind("change", function () {
            $("#series option").remove();
            $("#s2id_series span:first").html("请选择");
            $("#series").append("<option value='' >请选择</option>")
            $("#marque option").remove();
            $("#s2id_marque span:first").html("请选择");
            $("#marque").append("<option value='' >请选择</option>")
            var brand = $("#brand").val()
            if (!brand) {
                return
            }
            $.ajax({
                url: "/bocAppOpportunity/getSeriesByBrandId",
                type: "POST",
                data: {'brandId': brand},
                success: function (result) {
                    for (var i = 0; i < result.list.length; i++) {
                        $("#series").append("<option value=" + result.list[i].id + ">" + result.list[i].name + "</option>")
                    }
                }
            });
        });

        $("#series").bind("change", function () {
            $("#marque option").remove();
            $("#s2id_marque span:first").html("请选择");
            $("#marque").append("<option value='' >请选择</option>")
            var series = $("#series").val()
            if (!series) {
                return
            }
            $.ajax({
                url: "/bocAppOpportunity/getMarqueBySeriesId",
                type: "POST",
                data: {'seriesId': series},
                success: function (result) {
                    for (var i = 0; i < result.list.length; i++) {
                        $("#marque").append("<option value=" + result.list[i].id + ">" + result.list[i].name + "</option>")
                    }
                }
            });
        });
    })
</script>
</body>
</html>
